import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);

const store = new Vuex.Store({
	state: {
		userInfo: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo') : null, //用户信息
		isLogin: false, //登录状态
	},
	mutations: {
		// 更改用户信息
		changeUser(state, payload) {
			state.userInfo = payload;
		},
		changeLogin(state, payload) {
			state.isLogin = payload;
		}
	}
})

export default store;